package com.aacar.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.aacar.dao.PersonalDao;
import com.aacar.dao.base.CommonBaseDao;
import com.aacar.entity.WashCarAddr;
import com.aacar.entity.WashCarPage;
import com.aacar.vo.WashCarVo;

@Repository("personalDao")
public class PersonalDaoImpl extends CommonBaseDao implements PersonalDao{
	
	private static final String nameSpace = "com.aacar.dao.PersonalDao.";
	
	//增加洗车地址
	public int addWashCarAddr(WashCarAddr washCarAddr) {
		return super.getSqlSession().insert(nameSpace.concat("addWashCarAddr"), washCarAddr);
	}
	
	//2.修改 3.删除
	public int updatePersonalWashCarRecord(WashCarAddr washCarAddr) {
		return super.getSqlSession().update(nameSpace.concat("updatePersonalWashCarRecord"), washCarAddr);
	}
	
	//3.查询车地址
	public List<WashCarVo> queryCarAddressList(WashCarPage washCarPage) {
		return super.getSqlSession().selectList(nameSpace.concat("queryCarAddressList"), washCarPage);
	}
	
	//4.查询总的数量
	public int queryCarAddressCount(WashCarPage washCarPage) {
		return super.getSqlSession().selectOne(nameSpace.concat("queryCarAddressCount"),washCarPage);
	}
	
	//根据某个用户查询用户下面所有的洗车地址
	public int updateCarAddressByUserId(WashCarAddr washCarAddr) {
		return super.getSqlSession().update(nameSpace.concat("updateCarAddressByUserId"),washCarAddr);
	}
	
	//查询车
	public WashCarVo queryCarAdrress(WashCarPage washCarPage) {
		return super.getSqlSession().selectOne(nameSpace.concat("queryCarAdrress"),washCarPage);
	}

}
